<template>
  <view>
    <web-view :src="drawioUrl" @message="handlePostMessage"></web-view>
  </view>
</template>

<script>
import { getToken } from '@/utils/auth'
export default {
  data() {
    return {
      drawioUrl: '',
    };
  },
  onLoad(e) {
    const token = getToken()
    this.drawioUrl = `https://mpdrawio.cdhongyi.com.cn?fileId=${e.fileId}&token=${token}`
  },
  methods: {
    handlePostMessage(data) {
      console.log("接收到消息：" + JSON.stringify(data.detail));
    },
  },
}
</script>

<style lang="scss"></style>
